This disclosure relates generally to loop processing in a data processing system and more specifically to transformation of a Unified Parallel C (UPC) programming language “for all” loop (“upc_forall” loop) in the data processing system.
Unified Parallel C (UPC) programming language is an explicit parallel extension to the standard C programming language, which enables concurrent execution of a program by multiple hardware threads. The UPC language adopts a single program multiple data (SPMD) programming model. In the SPMD model, every thread executes the same program and every running thread executes every program statement concurrently.
The UPC language also adheres to a partitioned global address space programming model (PGAS). In a PGAS program, certain data structures (for example, shared arrays) are globally visible to all threads and are physically allocated across all available memory in a cluster. The UPC language specification allows shared arrays to be distributed in blocks of one or more contiguous elements across each compute node in the cluster.
The UPC memory space available to a thread is divided into private and shared portions. Each UPC thread has exclusive access to its own private memory space, and has access to the entire shared memory space. The shared memory space is logically subdivided into a number of partitions, which are physically allocated in the memory space of each thread. A thread is said to have “affinity” to the portion of the shared memory space physically allocated in the memory space that belongs to that thread.